package com.yidu.tmall.product.hujiafu.impl;

import com.yidu.tmall.common.domain.YiduSpecificationType;
import com.yidu.tmall.common.mapper.YiduSpecificationTypeMapper;
import com.yidu.tmall.product.hujiafu.service.YiduSpecificationTypeService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
@Service
public class YiduSpecificationTypeinpl implements YiduSpecificationTypeService {
    @Resource
    YiduSpecificationTypeMapper yiduSpecificationTypeMapper;

    @Override
    public int deleteByPrimaryKey(String sptId) {
        return yiduSpecificationTypeMapper.deleteByPrimaryKey(sptId);
    }

    @Override
    public int addAndUpdate(YiduSpecificationType record) {
        int i=0;
       if (!StringUtils.isEmpty(record.getSptId())){
           i=yiduSpecificationTypeMapper.insertSelective(record);
       }else{
          i= yiduSpecificationTypeMapper.updateByPrimaryKey(record);
       }
       return i;
    }

    @Override
    public int insertSelective(YiduSpecificationType record) {
        return 0;
    }

    @Override
    public YiduSpecificationType selectByPrimaryKey(String sptId) {
        return yiduSpecificationTypeMapper.selectByPrimaryKey(sptId);
    }

    @Override
    public int updateByPrimaryKeySelective(YiduSpecificationType record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(YiduSpecificationType record) {
        return 0;
    }
}
